import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-09-15
 * Time:9:03
 */

class Counter5 {
    public  int sum=0;
    public  void increase(){
        sum++;
    }
}

public class Demo10 {
    public static void main(String[] args) throws InterruptedException {
        Counter5 counter5=new Counter5();
        Thread t1=new Thread(){
            @Override
            public void run() {
                while(counter5.sum==0){

                }
                System.out.println("线程t1结束");
            }
        };
        Thread t2=new Thread(new Runnable() {
            @Override
            public void run() {
                Scanner scanner=new Scanner(System.in);
                counter5.sum=scanner.nextInt();
            }
        });
        t1.start();
        t2.start();

    }
}
